Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(falcon): Don't exhaust request body stream #3768

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

szokeasaurusrex
Copy link
Member

Only read the cached request._media, since reading request.media will exhaust the request.bounded_stream if it has not been read before. Note that this means that we will now only send the JSON request body to Sentry if the Falcon request handler reads the JSON data.

Fixes #3761

Copy link

codecov bot commented Nov 13, 2024

❌ 20 Tests Failed:

Tests completed Failed Passed Skipped
13694 20 13674 4113
View the top 3 failed tests by shortest run time
tests.integrations.falcon.test_falcon test_falcon_large_json_request
Stack Traces | 0.055s run time
.../integrations/falcon/test_falcon.py:230: in test_falcon_large_json_request
    assert event["_meta"]["request"]["data"]["foo"]["bar"] == {
E   KeyError: 'foo'
tests.integrations.falcon.test_falcon test_falcon_empty_json_request[empty-list]
Stack Traces | 0.056s run time
.../integrations/falcon/test_falcon.py:256: in test_falcon_empty_json_request
    assert event["request"]["data"] == data
E   AssertionError: assert '' == []
E     +''
E     -[]
tests.integrations.falcon.test_falcon test_falcon_request_media
Stack Traces | 0.057s run time
.../integrations/falcon/test_falcon.py:494: in test_falcon_request_media
    app.add_middleware(SentryCaptureMiddleware())
E   AttributeError: 'API' object has no attribute 'add_middleware'

To view more test analytics, go to the Test Analytics Dashboard
Got feedback? Let us know on Github

@szokeasaurusrex szokeasaurusrex enabled auto-merge (squash) November 13, 2024 12:41
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/fix-falcon branch 3 times, most recently from 68e1839 to 80164b7 Compare November 13, 2024 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

request.bounded_stream is consumed
1 participant